import 'package:untitled/generated/json/base/json_convert_content.dart';
import 'package:untitled/res_entity.dart';

ResEntity $ResEntityFromJson(Map<String, dynamic> json) {
	final ResEntity resEntity = ResEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		resEntity.code = code;
	}
	final double? latitude = jsonConvert.convert<double>(json['latitude']);
	if (latitude != null) {
		resEntity.latitude = latitude;
	}
	final ResLocation? location = jsonConvert.convert<ResLocation>(json['location']);
	if (location != null) {
		resEntity.location = location;
	}
	final double? longitude = jsonConvert.convert<double>(json['longitude']);
	if (longitude != null) {
		resEntity.longitude = longitude;
	}
	return resEntity;
}

Map<String, dynamic> $ResEntityToJson(ResEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['latitude'] = entity.latitude;
	data['location'] = entity.location.toJson();
	data['longitude'] = entity.longitude;
	return data;
}

ResLocation $ResLocationFromJson(Map<String, dynamic> json) {
	final ResLocation resLocation = ResLocation();
	final String? city = jsonConvert.convert<String>(json['city']);
	if (city != null) {
		resLocation.city = city;
	}
	final String? county = jsonConvert.convert<String>(json['county']);
	if (county != null) {
		resLocation.county = county;
	}
	final String? prov = jsonConvert.convert<String>(json['prov']);
	if (prov != null) {
		resLocation.prov = prov;
	}
	return resLocation;
}

Map<String, dynamic> $ResLocationToJson(ResLocation entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['city'] = entity.city;
	data['county'] = entity.county;
	data['prov'] = entity.prov;
	return data;
}